import unittest
import requests


class TpLogin:
    se = None

    @classmethod
    def login_v(cls, se):
        if se is None:
            url_v = "http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify"
            se.get(url_v)

    @classmethod
    def __free_session(cls):
        if cls.se:
            cls.se.close()
            cls.se = None

    @classmethod
    def login_ok(cls, login_data, se):
        url_lo = "http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login"
        rse = se.post(url_lo, data=login_data)
        return rse
